package com.imooc.project.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.imooc.project.dao.CustomerMapper;
import com.imooc.project.entity.Customer;
import com.imooc.project.service.CustomerService;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author zhou
 * @since 2021-06-18
 */
@Service
public class CustomerServiceImpl extends ServiceImpl<CustomerMapper, Customer> implements CustomerService {

    @Override
    public List<Map<String, Object>> findExcelList(Map cmap) {
        List<Customer> rb = lambdaQuery().list();
        List<Map<String, Object>> relist = new ArrayList<>();
        for (Customer customer : rb) {
            Map map = new LinkedHashMap();
            map.put("customerId", customer.getCustomerId());//用户编号
            map.put("name", customer.getName());//姓名
            map.put("section", customer.getSection());//所属部门
            map.put("station", customer.getStation());//岗位名称
            map.put("sex", customer.getSex());//性别
            map.put("phone", customer.getPhone());//手机号码
            map.put("computerIp", customer.getComputerIp());//电脑IP
            relist.add(map);
        }
        return relist;
    }
}
